import 'package:json_annotation/json_annotation.dart';

import 'area_style.dart';
import 'item_style.dart';
import 'line_style.dart';
import 'text_style.dart';

part 'data_zoom.g.dart';

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class DataBackground {
  LineStyle? lineStyle;
  AreaStyle? areaStyle;

  DataBackground({this.lineStyle, this.areaStyle});

  factory DataBackground.fromJson(Map<String, dynamic> json) =>
      _$DataBackgroundFromJson(json);
  Map<String, dynamic> toJson() => _$DataBackgroundToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class DataZoomEmphasis {
  ItemStyle? handleStyle;
  ItemStyle? moveHandleStyle;

  DataZoomEmphasis({this.handleStyle, this.moveHandleStyle});

  factory DataZoomEmphasis.fromJson(Map<String, dynamic> json) =>
      _$DataZoomEmphasisFromJson(json);
  Map<String, dynamic> toJson() => _$DataZoomEmphasisToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class DataZoom {
  var id;

  DataZoom({this.id});

  factory DataZoom.fromJson(Map<String, dynamic> json) =>
      _$DataZoomFromJson(json);
  Map<String, dynamic> toJson() => _$DataZoomToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class InsideDataZoom extends DataZoom {
  //inside
  var type = 'inside';
  var disabled;
  var xAxisIndex;
  var yAxisIndex;
  var radiusAxisIndex;
  var angleAxisIndex;
  var filterMode;
  var start;
  var end;
  var startValue;
  var endValue;
  var minSpan;
  var maxSpan;
  var minValueSpan;
  var maxValueSpan;
  var orient;
  var zoomLock;
  var throttle;
  var rangeMode;
  var zoomOnMouseWheel;
  var moveOnMouseMove;
  var moveOnMouseWheel;

  InsideDataZoom(
      {this.disabled,
      this.xAxisIndex,
      this.yAxisIndex,
      this.radiusAxisIndex,
      this.angleAxisIndex,
      this.filterMode,
      this.start,
      this.end,
      this.startValue,
      this.endValue,
      this.minSpan,
      this.maxSpan,
      this.minValueSpan,
      this.maxValueSpan,
      this.orient,
      this.zoomLock,
      this.throttle,
      this.rangeMode,
      this.zoomOnMouseWheel,
      this.moveOnMouseMove,
      this.moveOnMouseWheel});

  factory InsideDataZoom.fromJson(Map<String, dynamic> json) =>
      _$InsideDataZoomFromJson(json);
  Map<String, dynamic> toJson() => _$InsideDataZoomToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class SliderDataZoom extends DataZoom {
  //inside
  var type = 'slider';
  var show;
  var backgroundColor;
  DataBackground? dataBackground;
  DataBackground? selectedDataBackground;

  var fillerColor;
  var borderColor;
  var handleIcon; //image:url path:
  var handleSize;

  ItemStyle? handleStyle;
  var moveHandleIcon;
  var moveHandleSize;
  ItemStyle? moveHandleStyle;
  var labelPrecision;
  var labelFormatter;
  var showDetail;
  var showDataShadow;
  var realtime;
  TextStyle? textStyle;
  var xAxisIndex;
  var yAxisIndex;
  var radiusAxisIndex;
  var angleAxisIndex;
  var filterMode;
  var start;
  var end;
  var startValue;
  var endValue;
  var minSpan;
  var maxSpan;
  var minValueSpan;
  var maxValueSpan;
  var orient;
  var zoomLock;
  var throttle;
  var rangeMode;

  var zlvel;
  var z;

  var left;
  var top;
  var right;
  var bottom;

  var brushSelect;
  ItemStyle? brushStyle;
  DataZoomEmphasis? emphasis;

  SliderDataZoom(
      {this.show,
      this.backgroundColor,
      this.dataBackground,
      this.selectedDataBackground,
      this.fillerColor,
      this.borderColor,
      this.handleIcon,
      this.handleSize,
      this.handleStyle,
      this.moveHandleIcon,
      this.moveHandleSize,
      this.moveHandleStyle,
      this.labelPrecision,
      this.labelFormatter,
      this.showDetail,
      this.showDataShadow,
      this.realtime,
      this.textStyle,
      this.xAxisIndex,
      this.yAxisIndex,
      this.radiusAxisIndex,
      this.angleAxisIndex,
      this.filterMode,
      this.start,
      this.end,
      this.startValue,
      this.endValue,
      this.minSpan,
      this.maxSpan,
      this.minValueSpan,
      this.maxValueSpan,
      this.orient,
      this.zoomLock,
      this.throttle,
      this.rangeMode,
      this.zlvel,
      this.z,
      this.left,
      this.top,
      this.right,
      this.bottom,
      this.brushSelect,
      this.brushStyle,
      this.emphasis});

  factory SliderDataZoom.fromJson(Map<String, dynamic> json) =>
      _$SliderDataZoomFromJson(json);
  Map<String, dynamic> toJson() => _$SliderDataZoomToJson(this);
}
